package controllers;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public  class Util {
	final private static DateFormat FORMATTER = new SimpleDateFormat("dd/MM/yyyy");
	public static Date data(String dd, String mm, String yyyy) {
		final String n = dd + "/" + mm + "/" + yyyy;
		Date nasc;
		try {
			nasc = FORMATTER.parse(n);
		} catch (ParseException e) {
			nasc = null;
		}
		return nasc;
	}
	public static Date data(String d) {
		Date dd;
		try {
			dd = FORMATTER.parse(d);
		} catch (ParseException e) {
			dd = null;
		}
		return dd;
	}
}